package com.province.platform.core.constants;

import org.apache.commons.lang3.StringUtils;

import java.io.File;

public class CoreConstants {
    // ----------------------------- 全局变量 ---------------------------------
    public static final String CORE_CONTAINER_JOB_ID = "core.container.job.id";

    public static final String CORE_CONTAINER_TASK_GROUP_CHANNEL = "core.container.taskGroup.channel";

    public static final String CORE_CONTAINER_TASK_GROUP_ID = "core.container.taskGroup.id";

    public static final String CORE_CONTAINER_JOB_REPORT_INTERVAL = "core.container.job.reportInterval";

    public static final String CORE_CONTAINER_JOB_SLEEP_INTERVAL = "core.container.job.sleepInterval";

    public static final String JOB_SETTING_KEY_TYPE = "job.setting.keyType";

    public static final String JOB_SETTING_PRIVATE_KEY = "job.setting.privateKey";

    public static final String JOB_SETTING_CHANNEL = "job.setting.channel";

    public static final String JOB_CONTENT_READER_CHANNEL = "job.content[0].reader.channel";

    public static final String JOB_CONTENT_WRITER_CHANNEL = "job.content[0].writer.channel";

    public static final String JOB_CONTENT_READER_NAME = "job.content[0].reader.name";

    public static final String JOB_CONTENT_WRITER_NAME = "job.content[0].writer.name";

    public static final String JOB_CONTENT_PLATFORM_NAME = "job.content.platform.name";

    public static final String JOB_CONTENT_PLATFORM_ENVIRONMENT = "job.content.platform.environment";

    public static final String JOB_CONTENT = "job.content";

    public static final String READER_NAME = "reader.name";

    public static final String WRITER_NAME = "writer.name";

    public static final String READER_PARAMETER = "reader.parameter";

    public static final String WRITER_PARAMETER = "writer.parameter";

    public static final String READER = "reader";

    public static final String WRITER = "writer";

    public static final String TASK_ID = "taskId";

    // ----------------------------- 环境变量 ---------------------------------
    public static String PLATFORM_HOME = System.getProperty("platform.home");

    public static String PLATFORM_CONFIG = ".platform.properties";

    public static String PLUGIN_READER_HOME = StringUtils.join(new String[] {PLATFORM_HOME, "plugin", "reader"}, File.separator);

    public static String PLUGIN_WRITER_HOME = StringUtils.join(new String[] {PLATFORM_HOME, "plugin", "writer"}, File.separator);

    public static String PLUGIN_TRANSMIT_HOME = StringUtils.join(new String[] {PLATFORM_HOME, "plugin", "transmit"}, File.separator);

    public static String PLATFORM_CONFIG_PATH = StringUtils.join(new String[] {PLATFORM_HOME, "..", "conf", PLATFORM_CONFIG}, File.separator);



}